const Card = require('../../Card.js');

class MiseryExploit extends Card {
    setupCardAbilities(ability) {
        this.play({
            gameAction: ability.actions.gainAmber((context) => ({
                amount: context.player.opponent
                    ? context.player.opponent.creaturesInPlay.filter((card) =>
                          card.hasToken('damage')
                      ).length
                    : 0
            }))
        });
    }
}

MiseryExploit.id = 'misery-exploit';

module.exports = MiseryExploit;
